package top.wilsonlv.jaguar.cloud.upms.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.wilsonlv.jaguar.cloud.upms.sdk.enums.ClientType;
import top.wilsonlv.jaguar.commons.web.response.JsonResult;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 用户前端控制器
 * </p>
 *
 * @author lvws
 * @since 2021-08-16
 */
@RestController
@RequestMapping("/clientType")
@Api(tags = "客户端类型管理")
public class ClientTypeController {

    @ApiOperation(value = "查询客户端类型")
    @GetMapping(value = "/list")
    public JsonResult<Map<String, String>> list() {
        ClientType[] clientTypes = ClientType.values();
        Map<String, String> map = new HashMap<>(clientTypes.length);
        for (ClientType clientType : clientTypes) {
            map.put(clientType.name(), clientType.getClientTypeName());
        }
        return JsonResult.success(map);
    }

}